{% import "utils.html" as utils %}
<form method="POST" action="/site/{{ userid }}/manage" onsubmit="return check()">

  <h2 class="text-center">网站管理</h2>
  <hr>

  {% if adminflg %}      
  <div>
    <label>
      <input type="checkbox"  name="site.regEn" {% if site.regEn %} checked="" {% endif %} > 禁止注册
    </label>
  </div>
  <div>
    <label>
      <input type="checkbox"  name="site.MustVerifyEmailEn" {% if site.MustVerifyEmailEn %} checked="" {% endif %} > 必须验证邮箱
    </label>
  </div>
  <div>
    <label class="control-label" for="note">日志保留天数:</label>
    <input type="text"  name="site.logDay" value="{{ logDay }}" placeholder="{{ logDay }}" oninput = "value=value.replace(/[^\d]/g,'')"> 
  </div>

  <div class="form-group">
    <label class="control-label" for="note" ><font color='red'>必须输入账号密码验证！！！</font></label>
    <div>
    <label class="control-label" for="note">管理员邮箱</label>
    </div>
    <input type="text" class="form-control" name="adminmail" value="" id="adminmail" placeholder="必须输入账号密码验证">
    <label class="control-label" for="note">管理员密码</label>
    <input type='password' class="form-control" value="" id="adminpwd" placeholder="必须输入账号密码验证">
    <input type="hidden" id="md5-password" name="adminpwd">
  </div>

  <div class="text-right">
    <button id="submit" type="submit" data-loading-text="loading..." class="btn btn-primary">提交</button>
  </div>

  {% else %}
  <div style="text-align:center"> 非管理员,不可查看 </div>
  {% endif %}

  {{ utils.submit_loading() }}
</form>

<script>
  function check() {
      var pwd = document.getElementById('adminpwd');
      var md5pwd = document.getElementById('md5-password');
      md5pwd.value = md5(pwd.value);
      //return false回阻止提交
      return true;
  }
</script>

